<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  
  <title>MySQL Snippets | gdme1320 的笔记</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Table of Contents   MySQL Users  Create User   DDL  显示建表语句 显示所有外键 Rename Table Rename database 显示表结构 Convert table character set 获取数据库大小   代码  Row Number       MySQL Users    Create User   create u">
<meta property="og:type" content="article">
<meta property="og:title" content="MySQL Snippets">
<meta property="og:url" content="http://gdme1320.gitee.com/mysql/snippets/index.html">
<meta property="og:site_name" content="gdme1320 的笔记">
<meta property="og:description" content="Table of Contents   MySQL Users  Create User   DDL  显示建表语句 显示所有外键 Rename Table Rename database 显示表结构 Convert table character set 获取数据库大小   代码  Row Number       MySQL Users    Create User   create u">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2022-03-23T09:58:59.067Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MySQL Snippets">
<meta name="twitter:description" content="Table of Contents   MySQL Users  Create User   DDL  显示建表语句 显示所有外键 Rename Table Rename database 显示表结构 Convert table character set 获取数据库大小   代码  Row Number       MySQL Users    Create User   create u">
  
    <link rel="alternate" href="/atom.xml" title="gdme1320 的笔记" type="application/atom+xml">
  
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">

  <link rel="stylesheet" href="/css/styles.css">
  <link rel="stylesheet" href="/css/docs.min.css">
  

</head>
</html>
<body>
  <nav class="navbar navbar-inverse">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-menu-navbar">
      <ul class="nav navbar-nav">
        
          <li><a class href="/index.html">Home</a></li>
        
          <li><a class href="/archives/">Archives</a></li>
        
      </ul>

      <!--
      <ul class="nav navbar-nav navbar-right">
        
          <li><a href="/atom.xml" title="RSS Feed"><i class="fa fa-rss"></i></a></li>
        
      </ul>
      -->
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

  <div class="container bs-docs-container">
  
    <div class="row">
        <div class="col-sm-8 blog-main">
          <article id="post-mysql/snippets" class="article article-type-post" itemscope itemprop="blogPost">

  <header class="article-header">
    
  
    <h1 class="article-title" itemprop="name">
      MySQL Snippets
    </h1>
  


  </header>

  <div class="article-meta">
    <div class="article-datetime">
  <a href="/mysql/snippets/" class="article-date"><time datetime="2020-06-03T16:00:00.000Z" itemprop="datePublished">2020-06-04</time></a>
</div>

    
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/mysql/">mysql</a>
  </div>


  </div>
  <div class="article-inner">

    <div class="article-entry" itemprop="articleBody">
      
        
<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgdaaf3a2">MySQL Users</a>
<ul>
<li><a href="#org36a7879">Create User</a></li>
</ul>
</li>
<li><a href="#org57f6188">DDL</a>
<ul>
<li><a href="#org208860c">显示建表语句</a></li>
<li><a href="#orgf1006e0">显示所有外键</a></li>
<li><a href="#org3ef14e6">Rename Table</a></li>
<li><a href="#org4f27063">Rename database</a></li>
<li><a href="#orgc65be23">显示表结构</a></li>
<li><a href="#org4743c23">Convert table character set</a></li>
<li><a href="#orgda16d55">获取数据库大小</a></li>
</ul>
</li>
<li><a href="#orgc6547f1">代码</a>
<ul>
<li><a href="#org5e7ed9f">Row Number</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-orgdaaf3a2">
<h2 id="orgdaaf3a2">MySQL Users</h2>
<div class="outline-text-2" id="text-orgdaaf3a2">
</div>
<div class="outline-3" id="outline-container-org36a7879">
<h3 id="org36a7879">Create User</h3>
<div class="outline-text-3" id="text-org36a7879">
<div class="org-src-container">
<pre class="src src-sql"><span style="font-weight: bold;">create</span> <span style="font-weight: bold;">user</span> user_name;
<span style="font-weight: bold;">grant</span> <span style="font-weight: bold;">all</span> <span style="font-weight: bold;">privileges</span> <span style="font-weight: bold;">on</span> *.* <span style="font-weight: bold;">to</span> user_name@<span style="font-style: italic;">'%'</span> identified <span style="font-weight: bold;">by</span> <span style="font-style: italic;">'password'</span> <span style="font-weight: bold;">with</span> <span style="font-weight: bold;">grant</span> <span style="font-weight: bold;">option</span>;
flush <span style="font-weight: bold;">privileges</span>;
</pre>
</div>
</div>
</div>
</div>
<div class="outline-2" id="outline-container-org57f6188">
<h2 id="org57f6188">DDL</h2>
<div class="outline-text-2" id="text-org57f6188">
</div>
<div class="outline-3" id="outline-container-org208860c">
<h3 id="org208860c">显示建表语句</h3>
<div class="outline-text-3" id="text-org208860c">
<div class="org-src-container">
<pre class="src src-sql">show <span style="font-weight: bold;">create</span> <span style="font-weight: bold;">table</span> &lt;<span style="font-weight: bold;">table_name</span>&gt;
</pre>
</div>
</div>
</div>
<div class="outline-3" id="outline-container-orgf1006e0">
<h3 id="orgf1006e0">显示所有外键</h3>
<div class="outline-text-3" id="text-orgf1006e0">
<div class="org-src-container">
<pre class="src src-sql"><span style="font-weight: bold;">SELECT</span> 
  <span style="font-weight: bold;">TABLE_NAME</span>,<span style="font-weight: bold;">COLUMN_NAME</span>,<span style="font-weight: bold;">CONSTRAINT_NAME</span>, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
<span style="font-weight: bold;">FROM</span>
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
<span style="font-weight: bold;">WHERE</span>
  REFERENCED_TABLE_SCHEMA = <span style="font-style: italic;">'&lt;database&gt;'</span> <span style="font-weight: bold;">AND</span>
  REFERENCED_TABLE_NAME = <span style="font-style: italic;">'&lt;table&gt;'</span> <span style="font-weight: bold;">AND</span>
  REFERENCED_COLUMN_NAME = <span style="font-style: italic;">'&lt;column&gt;'</span>;
</pre>
</div>
</div>
</div>
<div class="outline-3" id="outline-container-org3ef14e6">
<h3 id="org3ef14e6">Rename Table</h3>
<div class="outline-text-3" id="text-org3ef14e6">
<div class="org-src-container">
<pre class="src src-sql">RENAME <span style="font-weight: bold;">TABLE</span> old_db.<span style="font-weight: bold;">table</span> <span style="font-weight: bold;">TO</span> new_db.<span style="font-weight: bold;">table</span>;
</pre>
</div>
</div>
</div>
<div class="outline-3" id="outline-container-org4f27063">
<h3 id="org4f27063">Rename database</h3>
<div class="outline-text-3" id="text-org4f27063">
<blockquote>
<p>
<a href="https://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name" target="_blank" rel="noopener">https://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name</a>
</p>
</blockquote>
<ol class="org-ol">
<li> RENAME {DATABASE | SCHEMA} db_name TO new_db_name;  有丢失数据的风险。</li>
<li>For InnoDB,  RENAME TABLE old_db.table TO new_db.table;  ，将表移到另一个数据库中。通过脚本自动化这个操作：</li>
</ol>
<div class="org-src-container">
<pre class="src src-shell"><span style="font-weight: bold;">for</span> table<span style="font-weight: bold;"> in</span> <span style="font-weight: bold;">`mysql -u root -ppassword -s -N -e "use old_db;show tables from old_db;"`</span>; <span style="font-weight: bold;">do</span> 
    mysql -u root -ppassword -s -N -e <span style="font-style: italic;">"use old_db;rename table old_db.$table to new_db.$table;"</span>; 
<span style="font-weight: bold;">done</span>;
</pre>
</div>
</div>
</div>
<div class="outline-3" id="outline-container-orgc65be23">
<h3 id="orgc65be23">显示表结构</h3>
<div class="outline-text-3" id="text-orgc65be23">
<div class="org-src-container">
<pre class="src src-sql"># 显示表的所有字段
<span style="font-weight: bold;">describe</span> &lt;<span style="font-weight: bold;">table</span> <span style="font-weight: bold;">name</span>&gt;
# 显示表的所有字段和字符集等信息
SHOW <span style="font-weight: bold;">FULL</span> COLUMNS <span style="font-weight: bold;">FROM</span> <span style="font-weight: bold;">table_name</span>;
</pre>
</div>
</div>
</div>
<div class="outline-3" id="outline-container-org4743c23">
<h3 id="org4743c23">Convert table character set</h3>
<div class="outline-text-3" id="text-org4743c23">
<blockquote>
<p>
<a href="https://stackoverflow.com/questions/1294117/how-to-change-collation-of-database-table-column" target="_blank" rel="noopener">https://stackoverflow.com/questions/1294117/how-to-change-collation-of-database-table-column</a>
</p>
</blockquote>
<p>
convert 同时也会更改所有列的字符集
</p>
<div class="org-src-container">
<pre class="src src-sql"><span style="font-weight: bold;">ALTER</span> <span style="font-weight: bold;">TABLE</span> <span style="font-weight: bold;">mytable</span> <span style="font-weight: bold;">CONVERT</span> <span style="font-weight: bold;">TO</span> <span style="font-weight: bold; text-decoration: underline;">CHARACTER</span> <span style="font-weight: bold;">SET</span> utf8mb4 
<span style="font-weight: bold;">ALTER</span> <span style="font-weight: bold;">TABLE</span> <span style="font-weight: bold;">MYTABLE</span> <span style="font-weight: bold;">CONVERT</span> <span style="font-weight: bold;">TO</span> <span style="font-weight: bold; text-decoration: underline;">CHARACTER</span> <span style="font-weight: bold;">SET</span> utf8mb4 <span style="font-weight: bold;">COLLATE</span> utf8mb4_unicode_ci;
</pre>
</div>
<p>
设置数据库默认的字符集，但是不会影响现有的表
</p>
<pre class="example">
ALTER SCHEMA database DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
</pre>
</div>
</div>
<div class="outline-3" id="outline-container-orgda16d55">
<h3 id="orgda16d55">获取数据库大小</h3>
<div class="outline-text-3" id="text-orgda16d55">
<blockquote>
<p>
<a href="https://database.guide/how-to-check-the-size-of-a-database-in-mysql/" target="_blank" rel="noopener">https://database.guide/how-to-check-the-size-of-a-database-in-mysql/</a>
</p>
</blockquote>
<div class="org-src-container">
<pre class="src src-sql"><span style="font-weight: bold;">SELECT</span> 
    table_schema <span style="font-style: italic;">'Database Name'</span>,
    <span style="font-weight: bold;">SUM</span>(data_length + index_length) <span style="font-style: italic;">'Size in Bytes'</span>,
    ROUND(<span style="font-weight: bold;">SUM</span>(data_length + index_length) / 1024 / 1024, 2) <span style="font-style: italic;">'Size in MiB'</span>
<span style="font-weight: bold;">FROM</span> information_schema.tables 
<span style="font-weight: bold;">GROUP</span> <span style="font-weight: bold;">BY</span> table_schema;
</pre>
</div>
<p>
Result:
</p>
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left">
<col class="org-right">
<col class="org-right">
</colgroup>
<thead>
<tr>
<th class="org-left" scope="col">Database Name</th>
<th class="org-right" scope="col">Size in Bytes</th>
<th class="org-right" scope="col">Size in MiB</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">information_schema</td>
<td class="org-right">0</td>
<td class="org-right">0.00</td>
</tr>
<tr>
<td class="org-left">Music</td>
<td class="org-right">98304</td>
<td class="org-right">0.09</td>
</tr>
<tr>
<td class="org-left">mysql</td>
<td class="org-right">2506752</td>
<td class="org-right">2.39</td>
</tr>
<tr>
<td class="org-left">performance_schema</td>
<td class="org-right">0</td>
<td class="org-right">0.00</td>
</tr>
<tr>
<td class="org-left">sakila</td>
<td class="org-right">6766592</td>
<td class="org-right">6.45</td>
</tr>
<tr>
<td class="org-left">Solutions</td>
<td class="org-right">16384</td>
<td class="org-right">0.02</td>
</tr>
<tr>
<td class="org-left">sys</td>
<td class="org-right">16384</td>
<td class="org-right">0.02</td>
</tr>
<tr>
<td class="org-left">world</td>
<td class="org-right">802816</td>
<td class="org-right">0.77</td>
</tr>
</tbody>
</table>
<div class="org-src-container">
<pre class="src src-sql">USE Music;
<span style="font-weight: bold;">SELECT</span> 
    table_schema <span style="font-style: italic;">'Database Name'</span>,
    <span style="font-weight: bold;">SUM</span>(data_length + index_length) <span style="font-style: italic;">'Size in Bytes'</span>,
    sys.FORMAT_BYTES(<span style="font-weight: bold;">SUM</span>(data_length + index_length)) <span style="font-style: italic;">'Size (Formatted)'</span>
<span style="font-weight: bold;">FROM</span> information_schema.tables 
<span style="font-weight: bold;">GROUP</span> <span style="font-weight: bold;">BY</span> table_schema;
</pre>
</div>
<p>
Result:
</p>
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left">
<col class="org-right">
<col class="org-left">
</colgroup>
<thead>
<tr>
<th class="org-left" scope="col">Database Name</th>
<th class="org-right" scope="col">Size in Bytes</th>
<th class="org-left" scope="col">Size (Formatted)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">information_schema</td>
<td class="org-right">0</td>
<td class="org-left">0 bytes</td>
</tr>
<tr>
<td class="org-left">Music</td>
<td class="org-right">98304</td>
<td class="org-left">96.00 KiB</td>
</tr>
<tr>
<td class="org-left">mysql</td>
<td class="org-right">2506752</td>
<td class="org-left">2.39 MiB</td>
</tr>
<tr>
<td class="org-left">performance_schema</td>
<td class="org-right">0</td>
<td class="org-left">0 bytes</td>
</tr>
<tr>
<td class="org-left">sakila</td>
<td class="org-right">6766592</td>
<td class="org-left">6.45 MiB</td>
</tr>
<tr>
<td class="org-left">Solutions</td>
<td class="org-right">16384</td>
<td class="org-left">16.00 KiB</td>
</tr>
<tr>
<td class="org-left">sys</td>
<td class="org-right">16384</td>
<td class="org-left">16.00 KiB</td>
</tr>
<tr>
<td class="org-left">world</td>
<td class="org-right">802816</td>
<td class="org-left">784.00 KiB</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="outline-2" id="outline-container-orgc6547f1">
<h2 id="orgc6547f1">代码</h2>
<div class="outline-text-2" id="text-orgc6547f1">
</div>
<div class="outline-3" id="outline-container-org5e7ed9f">
<h3 id="org5e7ed9f">Row Number</h3>
<div class="outline-text-3" id="text-org5e7ed9f">
<div class="org-src-container">
<pre class="src src-sql"><span style="font-weight: bold;">SET</span> @row_number = 0;
<span style="font-weight: bold;">SELECT</span>
    (@row_number:=@row_number + 1) <span style="font-weight: bold;">AS</span> `row_number`, ...
<span style="font-weight: bold;">FROM</span> ...
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2020-6-4</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer" target="_blank" rel="noopener">Validate</a></p>
</div>

      
    </div>

    
      

    

    <footer class="article-footer">
      <a data-url="http://gdme1320.gitee.com/mysql/snippets/" data-id="cl13eo7k3008ohjv4qdyo650w" class="article-share-link">
        <i class="fa fa-share"></i> Share
      </a>
      
      

    </footer>
  </div>
  
    
<ul id="article-nav" class="nav nav-pills nav-justified">
  
  <li role="presentation">
    <a href="/linux/kde/akonadi/" id="article-nav-older" class="article-nav-link-wrap">
      <i class="fa fa-chevron-left pull-left"></i>
      <span class="article-nav-link-title">Akonadi</span>
    </a>
  </li>
  
  
  <li role="presentation">
    <a href="/mysql/mariadb-client/" id="article-nav-newer" class="article-nav-link-wrap">
      <span class="article-nav-link-title">Mariadb Client 与 MySQL Client不同的地方</span>
      <i class="fa fa-chevron-right pull-right"></i>
    </a>
  </li>
  
</ul>


  
</article>




        </div>
        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
          
  
  <div class="sidebar-module">
    <h4>Categories</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/apps/">apps</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/architecture/">architecture</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/">devops</a><span class="sidebar-module-list-count">10</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubectl/">kubectl</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubernetes/">kubernetes</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/">dotnet</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/entityframework/">entityframework</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/elasticsearch/">elasticsearch</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/">emacs</a><span class="sidebar-module-list-count">4</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/org-mode/">org-mode</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/git/">git</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/graphql/">graphql</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/groovy/">groovy</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/">java</a><span class="sidebar-module-list-count">52</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/concurrent/">concurrent</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/jackson/">jackson</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/shiro/">shiro</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring/">spring</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/">spring-amqp</a><span class="sidebar-module-list-count">5</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-security/">spring-security</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/">thymeleaf</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/maven/">maven</a><span class="sidebar-module-list-count">1</span></li></ul></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/jenkins/">jenkins</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/journal/">journal</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/js/">js</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/">linux</a><span class="sidebar-module-list-count">35</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kde/">kde</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/">kross</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/ktorrent-scripts/">ktorrent-scripts</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/shell/">shell</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/tcp/">tcp</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/lisp/">lisp</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mongodb/">mongodb</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mssql/">mssql</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mysql/">mysql</a><span class="sidebar-module-list-count">12</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/nginx/">nginx</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/node/">node</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/">postgresql</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/client/">client</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/python/">python</a><span class="sidebar-module-list-count">19</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/regex/">regex</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/rfc/">rfc</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/vim/">vim</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/windows/">windows</a><span class="sidebar-module-list-count">7</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tags</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ReentrantLock/">ReentrantLock</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/nohup/">nohup</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/pandoc/">pandoc</a><span class="sidebar-module-list-count">1</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tag Cloud</h4>
    <p class="tagcloud">
      <a href="/tags/ReentrantLock/" style="font-size: 10px;">ReentrantLock</a> <a href="/tags/nohup/" style="font-size: 10px;">nohup</a> <a href="/tags/pandoc/" style="font-size: 10px;">pandoc</a>
    </p>
  </div>


  
  <div class="sidebar-module">
    <h4>Archives</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2919/06/">June 2919</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/03/">March 2022</a><span class="sidebar-module-list-count">58</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/01/">January 2022</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/11/">November 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/10/">October 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/04/">April 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/03/">March 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/02/">February 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/01/">January 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/12/">December 2020</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/11/">November 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/10/">October 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/09/">September 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/07/">July 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/06/">June 2020</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/04/">April 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/03/">March 2020</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/02/">February 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/01/">January 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/12/">December 2019</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/11/">November 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/10/">October 2019</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/09/">September 2019</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/08/">August 2019</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/07/">July 2019</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/06/">June 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/05/">May 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/04/">April 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/03/">March 2019</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/02/">February 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/01/">January 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/11/">November 2018</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/10/">October 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/08/">August 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/07/">July 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/06/">June 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/03/">March 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/07/">July 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/06/">June 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/04/">April 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/05/">May 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/1970/01/">January 1970</a><span class="sidebar-module-list-count">9</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Recents</h4>
    <ul class="sidebar-module-list">
      
        <li>
          <a href="/java/acessing-generic-types-at-runtime/">获取泛型类型</a>
        </li>
      
        <li>
          <a href="/linux/shell/bash_cgi/">Script for Shell Parsing Parameters</a>
        </li>
      
        <li>
          <a href="/linux/shell/shell-script/">Shell Script Getting Start</a>
        </li>
      
        <li>
          <a href="/linux/tcp/network-tcp-performance-turning-with-sysctl/">【翻译】Sysctl调节Linux网络性能</a>
        </li>
      
        <li>
          <a href="/java/concurrent/aqs-src/">AQS源码笔记</a>
        </li>
      
    </ul>
  </div>



        </div>
    </div>
  </div>
  <footer class="blog-footer">
  <div class="container">
    <div id="footer-info" class="inner">
      &copy; 2022 gdme1320<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

  

<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script> -->

<script src="/js/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>



<script src="/js/script.js"></script>

</body>
</html>
